import { getMerchantExpand } from '@/api/merchant';
import { onMounted, ref } from 'vue';
const templateFontList = ref([
    { label: '思源黑体', value: 'A', isDefault: true },
    { label: '雅思细体', value: 'B', isDefault: false },
    { label: '方正楷体简体', value: 'C', isDefault: true },
    { label: '隶书', value: 'D', isDefault: true },
    { label: '幼圆', value: 'E', isDefault: true },
]);

export default function useMerchant() {
    const merchantExpandData: any = ref({
        id: 0,
        warningApOffline: '',
        warningDevDown: '',
        warningJqOffline: '',
        warningPower: '',
        warningTemperature: '',
        isApOfflineWarning: '',
        isDevDownWarning: '',
        isJqOfflineWarning: '',
        isMailWarning: '',
        isPowerWarning: '',
        warningMobile: '',
        warningMail: '',
    });
    // let templateFontList: string[] = [];
    const getData = async () => {
        const res: any = await getMerchantExpand({ page: 1, size: 1 });
        merchantExpandData.value = res[0];
        // 已选择字体
        // const list = res.content[0].templateFont ? res.content[0].templateFont.split(',') : [];
        // templateFontList.value.forEach((item) => {
        //     item.isDefault = list.includes(item.value);
        // });
    };

    onMounted(() => {
        getData();
    });
    return { templateFontList, merchantExpandData };
}
